<%@page import="org.springframework.security.core.context.SecurityContextHolder"%>
<%@page import="org.apache.commons.lang.StringUtils"%>
<%@page import="org.apache.commons.lang.time.DateFormatUtils"%>
<%@page import="org.springframework.util.CollectionUtils"%>
<%@page import="java.util.Collection"%>
<%@ include file="../common/common_include.jsp"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
	NoticeForm form = (NoticeForm)request.getAttribute("command");
	String group = StringUtils.isNotBlank(form.getGroup())?form.getGroup():Constants.NOTICE_GROUP_NOTICE;
	UserInfo user = (UserInfo)SecurityContextHolder.getContext().getAuthentication().getPrincipal();
	String userName = user.getName();
	String siteName = user.getSiteName();
	String siteId = user.getSiteId();
	String nowDate = DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss");
%>

<div>
	<%-- <form id="noticeAddForm" target="_coreIframe" method="post" action="<%=request.getContextPath()%>/notice/doAdd"> --%>
	<form id="noticeAddForm" target="_coreIframe" method="post" action="<%=request.getContextPath()%>/notice/doAdd"
	enctype="multipart/form-data">
		<div class="breadcrumb">
			<div class="bcIcon"></div>
			<ul class="bcNav">
				<li>发布营运日报</li>
			</ul>
		</div>
		<input type="hidden" name="centerSite" value="<%=siteId%>">
		<table class="formTable">
			<!-- <tr>
				<td class="tdTitle">公告类型：</td>
				<td>
					<select name="group">
						<option value="0">内部公告</option>
						<option value="1">营运日报</option>
					</select>
				</td>
			</tr> -->
			<input type="hidden" name="group" value="1">
			<tr>
				<td class="tdTitle">发布人：</td>
				<td><input class="inputText xs" type="text" value="<%=userName%>" name="publicMan">
					<span class="errorTipWrap" id="errorTip_publicMan"></span>
				</td>
			</tr>
			<tr>
				<td class="tdTitle">发布时间：</td>
				<td><input class="inputText xs" type="text" value="<%=nowDate %>" name="publicTime" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" disabled= "disabled" readonly="readonly"></td>
			</tr>	
			<tr>
				<td class="tdTitle">标题：</td>
				<td>
					<input class="inputText l" type="text" value="" name="title">
					<span class="errorTipWrap" id="errorTip_title"></span>
				</td>
			</tr>
			<!-- <tr>
				<td class="tdTitle">可选属性：</td>
				<td class="" colspan="2">
					<div class="checkbox-wrap">
						<label>
							<input type="checkbox" value="1" name="istop" class="checkbox">
							<span>置顶</span>
						</label>
						<label>
							<input type="checkbox" value="1" name="isimportant" class="checkbox">
							<span>重要</span>
						</label>
					</div>
				</td>
			</tr> -->

			<tr>
				<td class="tdTitle">详细内容：</td>
				<td class="" colspan="2">
					<div style="padding-top:10px;padding-bottom:10px;">
					<textarea id="notice_content" class="notice_content" name="content" 
					style=" visibility: hidden;"></textarea>
					</div>
					<span class="errorTipWrap" id="errorTip_content"></span>
				</td>
			</tr>
			
			<%-- <tr s='0'>
				<td class="tdTitle">主送：</td>
				<td><input class="inputText xs" type="text" value="总经理" name="sendTo"></td>
			</tr>
			<tr s='0'>
				<td class="tdTitle">抄送：</td>
				<td><input class="inputText xs" type="text" value="各分公司 网管中心各部门" name="copyTo"></td>
			</tr>
			<tr s='0'>
				<td class="tdTitle">发文：</td>
				<td><input class="inputText xs" type="text" value="<%=siteName%> 营运部" name="publicDepart"></td>
			</tr> --%>
			
			<tr>
				<td class="tdTitle"></td>
				<td>
					<div>
						<input class="input-btn-microsoft" type="submit" value="提交">
						<a class="a-btn-microsoft" href="javascript:XF.Notice.listNotice('<%=group%>','','1')">取消</a>
					</div>
				</td>
			</tr>	
		</table>
	</form>
	<iframe id="_coreIframe" name="_coreIframe" style="display: none;"></iframe>
</div>
<script type="text/javascript">
	$(function() {
		XF.createKindEditor("notice_content");
		$("input[name=title]").focus();//主动指定焦点，防止ie的bug
		XF.Notice.init();
	});
</script>



